<template>
	<!--   -->
	<view class="jy-wrap" v-if="isLogin">
		<bnn-loading :loading="isLoading"/>
		<view class="jy-topWrap">
			<view class="jy-content-t">
				<view class="content-text">
					<view class="title-gray">实盘资金<u-icon name="eye-fill"></u-icon>
					</view>
					<view class="text-number">{{contentData.balance}}</view>
				</view>
				<view class="content-text-r">
					<view class="title-gray">资金使用率</view>
					<view class="paogress_class">
						<!--  -->
						<view style="color:#FA3534 ;">{{(contentData.currMargin/Accountprice*100).toFixed(2)}}%</view>
						<u-line-progress class="progress" active-color="#FF9900" :height="15" round :percent="(contentData.currMargin/Accountprice*100).toFixed(2)"></u-line-progress>
					</view>
				</view>
			</view>
			<view class="jy-content-b">
				<view class="content-l">
					<span class="title-class">总盈亏:</span>
					<span>{{contentData.positionProfit+contentData.closeProfit}}</span>
				</view>
				<view class="content-r">
					<span class="title-class">可用保证金:</span>
					<!-- .toFixed(2) -->
					<span>{{contentData.available}}</span>
				</view>
			</view>
		</view>
		<view class="jy-dataWrap">
			<view class="search-wrap">
				<!-- <view class="dropdown-wrap"> -->
					<!-- <u-dropdown>
						<u-dropdown-item v-model="value" title="螺纹钢2105 rb2105" :options="myFuturesData"></u-dropdown-item>
					</u-dropdown> -->
					<!-- <u-dropdown ref="uDropdown">
						<u-dropdown-item title="属性" menu-icon="search">
							<view class="slot-content">
								<view class="u-text-center u-content-color u-m-t-20 u-m-b-20">其他自定义内容</view>
								<u-button type="primary" @click="closeDropdown">确定</u-button>
							</view>
						</u-dropdown-item>
					</u-dropdown> -->
				<!-- </view> -->
				<view class="search_cont" @click="searchTextFn">
					<view class="">
						{{searchText}}  {{chText}}
					</view>
					<u-icon name="arrow-down"></u-icon>
				</view>
				<view class="search" @click="searchFn">
					<image src="../../../static/images/search.png"></image>
				</view>
			</view>
			<u-popup v-model="show" mode="bottom" height="200px" :closeable="true">
				<view class="popup_tit">
					我的自选
				</view>
					<view class="content">
						<view class="cont_item" :class="index==value?'sta':''" v-for="(item,index) in myFuturesData" :key="index" @click="clickFutures(index,item.name)">
							{{item.name}}
						</view>
						<!-- <view class="cont_item">
							螺纹钢2105
						</view>
						<view class="cont_item">
							螺纹钢2105
						</view>
						<view class="cont_item">
							螺纹钢2105
						</view> -->
					</view>
				</u-popup>
			<view class="dataView">
				<view class="data-l">
					<view class="data-l-wrap">
						<view class="number-l">{{dealData.last_price}}</view>
						<view class="number-r">
							<view>{{dealData.last_price - dealData.pre_settlement> 0 ? '+' + (dealData.last_price - dealData.pre_settlement).toFixed(2) : (dealData.last_price - dealData.pre_settlement).toFixed(2)}}</view>
							<view>{{dealData.hl}} %</view>
						</view>
					</view>
				</view>
				<view class="data-r">
					<view class="right-wrap">
						<view class="right-number">
							<view>卖价 <span style="color: #FA3534;margin-left: 5px;">{{dealData.ask_price1}}</span></view>
							<view>买价 <span style="color: #FA3534;margin-left: 5px;">{{dealData.bid_price1}}</span></view>
						</view>
						<view class="right-number">
							<view>卖量 <span style="color: #FA3534;margin-left: 5px;">{{dealData.ask_volume1}}</span></view>
							<view>买量 <span style="color: #FA3534;margin-left: 5px;">{{dealData.bid_volume1}}</span></view>
						</view>
					</view>
				</view>
			</view>
			<view class="acount-wrap">
				<view class="zhangWrap" @click="ToTrading(1,dealData.instrument_id)">
					<view class="zhang-t">
						<image src="../../../static/images/shangzhang.png"></image>
						<span>买涨</span>
					</view>
					<view class="zhang-b">
						<span>后市价格上涨盈利</span>
					</view>
				</view>
				<view class="dieWrap" @click="ToTrading(2,dealData.instrument_id)">
					<view class="zhang-t">
						<image src="../../../static/images/shujuxiajiangqushixiadie.png"></image>
						<span>买跌</span>
					</view>
					<view class="zhang-b">
						<span>后市价格下跌盈利</span>
					</view>
				</view>
				<view class="pingWrap" @click="ToTrading(3,dealData.instrument_id)">
					<view class="zhang-t">
						<image src="../../../static/images/pingcang.png"></image>
						<span>平仓</span>
					</view>
					<view class="zhang-b">
						<span>先开先平</span>
					</view>
				</view>
			</view>
		</view>
		<view class="table-wrap">
			<u-tabs :list="list" inactive-color="#333" active-color="#fda600" :is-scroll="false" :current="current" @change="change"></u-tabs>	
			<!-- <view> 
			<u-tabs-swiper ref="uTabs" :list="list" inactive-color="#333" active-color="#fda600" :current="current" @change="tabsChange" :is-scroll="false"
			 swiperWidth="750"></u-tabs-swiper>
			</view> -->
			<!--  {height:screenHeight+'px'}-->
			<swiper :style="{height:screenHeight+'px'}" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
				<swiper-item class="swiper-item">
					<!--  v-for="(item, index) in tabs" :key="index" -->
						<u-table class="positoncont" border-color="#ffffff" padding="10px 0">
							<u-tr class="u-tr">
								<u-th class="u-th" width="30%">合约/方向</u-th>
								<u-th class="u-th" width="30%">可用/总仓</u-th>
								<u-th class="u-th" width="20%">成本价</u-th>
								<u-th class="u-th" width="20%">总盈亏</u-th>
								<!-- <u-th class="u-th" width="20%">总盈亏</u-th> -->
							</u-tr>
							<!-- :class="statebtn?'checked':''" -->
							<scroll-view scroll-y="true" style="height: 400px;width: 100%;">
							<view class="Position" v-for="(item,index) in PositionData" :key="index" :class="statebtn==index?'checked':''">
								<view class="" @click="checkedFn(index)">
										<!-- <view class="">{{item.posiDirection}},{{item.hedgeFlag}}</view> -->
									<view class="tionitem">
										<view class="item1">
											<text>{{item.instrumentID}}</text>
											<text v-if="item.posiDirection==2" :style="{color:item.posiDirection==2?'#ff4d59':''}">涨</text>
											<text v-if="item.posiDirection==3" :style="{color:item.posiDirection==3?'#3dbf61':''}">跌</text>
										</view>
										<view class="item2">{{item.position}} / {{item.position}}</view>
										<view class="item3">{{parseInt(item.ageprice/item.agenum)}}</view>
										<!-- <view class="item4"> <text :style="{color:item.positionProfit>0?'#ff4d59':'#3dbf61'}">{{item.ydPosition==0?item.positionProfit:item.ByTrade+item.positionProfit}}</text></view> -->
										<view class="item4"> <text :style="{color:item.positionProfit>0?'#ff4d59':'#3dbf61'}">{{item.positionProfit}}</text></view>
									</view>
									<view class="Positionbtn checked" v-if="statebtn==index">
										<u-button class="btnStyle" size="mini" @click="ToTrading2(item)">平仓</u-button>
										<u-button class="btnStyle1" size="mini" @click="ToTrading3(item)">止盈止损</u-button>
									</view>
								</view>
							</view>
							
							<u-empty v-if="PositionData.length==0" text="暂无持仓记录" mode="order" margin-top="20"></u-empty>
							<view class="Positionnum" v-if="PositionData.length>0">--共有  {{PositionData.length}}  条持仓记录--</view>
							</scroll-view>
						</u-table>
				</swiper-item>
				<swiper-item class="swiper-item">
					<!--  v-for="(item, index) in tabs" :key="index" -->
						<u-table class="positoncont" border-color="#ffffff" padding="10px 0">
							<u-tr class="u-tr">
								<u-th class="u-th" width="25%">合约/方向</u-th>
								<u-th class="u-th" width="15%">状态</u-th>
								<u-th class="u-th" width="25%">可撤/委托</u-th>
								<u-th class="u-th" width="15%">委托价</u-th>
								<u-th class="u-th" width="20%">委托时间</u-th>
							</u-tr>
							<!--  v-for="(item,index) in DeclarationData" :key="index" volumeTotal volumeTraded-->
							<scroll-view scroll-y style="height: 400px;width: 100%;" @scrolltolower="onreachBottom">
									<!-- direction 1卖 0买 -->
									<!-- combOffsetFlag 1平 0跌 -->
									<!-- 卖出+平仓=卖涨，买入+平仓=卖跌 -->
									<!-- 买入+开仓= 买涨，卖出+开仓=买跌 -->
								<view class="Position" v-for="(item,index) in DeclarationData" :key="index">
										<view class="tionitem">
											<view class="Decitem1">
												<text>{{item.instrumentID}}</text>
												<view v-if="item.direction==0&&item.combOffsetFlag==0" :style="{color:item.direction==0&&item.combOffsetFlag==0?'#ff4d59':'#3dbf61'}">买涨</view>
												<view v-else-if="item.direction==1&&item.combOffsetFlag==0" :style="{color:item.direction==0&&item.combOffsetFlag==0?'#ff4d59':'#3dbf61'}">买跌</view>
												<view v-else-if="item.direction==1&&item.combOffsetFlag==1" :style="{color:item.direction==0&&item.combOffsetFlag==0?'#ff4d59':'#3dbf61'}">平涨</view>
												<view v-else="item.direction==0&&item.combOffsetFlag==1" :style="{color:item.direction==0&&item.combOffsetFlag==0?'#ff4d59':'#3dbf61'}">平跌</view>
											</view>
											<view class="Decitem2" :class="item.stag==0?'stag':''" v-if="item.stag==0" @click="repealFn(item,index)">可撤</view>
											<view class="Decitem2" v-if="item.stag==1">已成交</view>
											<view class="Decitem2" v-if="item.stag==2">已撤单</view>
											<view class="Decitem3">{{item.volumeTotalOriginal-item.gnum}}/{{item.volumeTotalOriginal}}</view>
											<view class="Decitem4">{{item.limitPrice}}</view>
											<view class="Decitem5">{{item.insertTime}}</view>
										</view>
								</view>
							<u-empty v-if="DeclarationData.length==0" text="暂无委托记录" mode="order" margin-top="20"></u-empty>
							</scroll-view>
							
									<!-- <span :style="{color:item.positionCost>0?'#ff4d59':'#3dbf61'}">{{item.positionCost}}</span> -->
						</u-table>
				</swiper-item>
				<swiper-item class="swiper-item">
					<!--  v-for="(item, index) in tabs" :key="index" -->
					<view class="condition_cont">
						<view class="condition_item" :class="condistate==1?'condistate':''" @click="condistateFn(1)">
							未触发条件单
						</view>
						<view class="condition_item" :class="condistate==2?'condistate':''" @click="condistateFn(2)">
							已触发条件单
						</view>
						<view class="condition_item" :class="condistate==3?'condistate':''" @click="condistateFn(3)">
							未触发损盈单
						</view>
						<view class="condition_item" :class="condistate==4?'condistate':''" @click="condistateFn(4)">
							已触发损盈单
						</view>
					</view>
					<view class="condition_type">
					<scroll-view scroll-y="true" style="height: 400px;width: 100%;">
						<scroll-view scroll-x="true" style="width: 900px;">
							<view class="type_cont">
								<view class="condi_item">合约/方向</view>
								<view class="condi_item1">手数</view>
								<view class="condi_item2">类型</view>
								<view class="condi_item3">触发条件</view>
							</view>
							<view class="">
								<view class="">
									
								</view>
							</view>
						</scroll-view>
							<u-empty class="emp-hight" v-if="conditionData.length==0" text="暂无条件单记录" mode="order" margin-top="20"></u-empty>
					<view class="condition_msg">
						<!-- <view class=""> -->
							<view class="feng">风险提示：</view>
							<view class="text">1）多个止盈止损，先达到成先触发；</view>
							<view class="text">2）若持仓单无同方向持仓，则未触发止盈止损自动删除；</view>
							<view class="text">3）因期货交易规则，触发不保证能委托成交</view>
						<!-- </view> -->
					</view>
					</scroll-view>
					</view>
				</swiper-item>
				<swiper-item class="swiper-item">
					<!--  v-for="(item, index) in tabs" :key="index" -->
						<u-table class="positoncont" border-color="#ffffff" padding="10px 0">
							<u-tr class="u-tr">
								<u-th class="u-th" width="30%">合约/方向</u-th>
								<u-th class="u-th" width="25%">成交手数</u-th>
								<u-th class="u-th" width="20%">成交价</u-th>
								<u-th class="u-th" width="25%">成交时间</u-th>
							</u-tr>
							<scroll-view scroll-y="true" style="height: 400px;width: 100%;">
							<!-- <u-tr class="u-tr" v-for="(item,index) in dataList" :key="index">
								<u-td class="u-td" width="30%">{{item.name}}
									<view :style="{color:item.isZhang?'#ff4d59':'#3dbf61'}">{{item.isZhang?'涨':'跌'}}</view>
								</u-td>
								<u-td class="u-td" width="30%">{{item.acount}}</u-td>
								<u-td class="u-td" width="20%">{{item.price}}</u-td>
								<u-td class="u-td" width="20%">
									<span :style="{color:item.isZhang?'#ff4d59':'#3dbf61'}">{{item.money}}</span>
								</u-td>
							</u-tr> -->
							<u-tr class="u-tr" v-for="(item,index) in marketionData" :key="index">
								<u-td class="u-td" width="30%">{{item.instrumentID}}
								<!-- <view class="">{{item.direction}}/{{item.combOffsetFlag}}</view> -->
								<view v-if="item.direction==0&&item.combOffsetFlag==0" :style="{color:item.direction==0&&item.combOffsetFlag==0?'#ff4d59':'#3dbf61'}">买涨</view>
								<view v-else-if="item.direction==1&&item.combOffsetFlag==0" :style="{color:item.direction==0&&item.combOffsetFlag==0?'#ff4d59':'#3dbf61'}">买跌</view>
								<view v-else-if="item.direction==1&&item.combOffsetFlag==1" :style="{color:item.direction==0&&item.combOffsetFlag==0?'#ff4d59':'#3dbf61'}">平涨</view>
								<view v-else :style="{color:item.direction==0&&item.combOffsetFlag==0?'#ff4d59':'#3dbf61'}">平跌</view>
								<!-- <view v-if="item.closeProfit!=''" :style="{color:item.closeProfit==0?'#ff4d59':'#3dbf61'}">{{PositionData.closeProfit==0?'买涨':'买跌'}}</view> -->
								</u-td>
								<u-td class="u-td" width="25%">{{item.volumeTotalOriginal}}</u-td>
								<u-td class="u-td" width="20%">{{item.limitPrice}}</u-td>
								<u-td class="u-td" width="25%">
									{{item.insertTime}}
								</u-td>
							</u-tr>
							<u-empty v-if="marketionData.length==0" text="暂无成交记录" mode="order" margin-top="20"></u-empty>
							</scroll-view>
						</u-table>
				</swiper-item>
			</swiper>
		</view>
		<u-popup v-model="isShow" mode="right">
			<view>
				<u-cell-group>
					<u-cell-item icon="account-fill" title="退出账户" @click="quitClick"></u-cell-item>
					<u-cell-item icon="account-fill" title="结算单" @click="affirm"></u-cell-item>
					<u-cell-item icon="account-fill" title="结算单查询" @click="affirmtime"></u-cell-item>
						<!-- <u-cell-item icon="integral-fill" title="会员等级" value="新版本"></u-cell-item> -->
				</u-cell-group>
			</view>
		</u-popup>
		<u-popup v-model="isweituo" width="70%" mode="center" border-radius="14" :mask-close-able="false">
			<view class="entrust">
				<view class="entrust_text">交易品种：{{globalmodul.instrumentID}}</view>
				<view class="entrust_text">操作：
					<text v-if="globalmodul.direction==0&&globalmodul.combOffsetFlag==0">买涨</text>
					<text v-else-if="globalmodul.direction==1&&globalmodul.combOffsetFlag==0">买跌</text>
					<text v-else-if="globalmodul.direction==1&&globalmodul.combOffsetFlag==1">平涨</text>
					<text v-else>平跌</text>
					<!-- {{globalmodul.direction==0?'买涨':'卖跌'}} -->
					/{{globalmodul.limitPrice}}/{{globalmodul.volumeTotalOriginal}}</view>
				<view class="entrust_text">结果：<text class="success">委托成功</text></view>
			</view>
			<view class="entrust_btn" @click="isweituoFn">确定</view>
		</u-popup>
		<u-popup v-model="ischedan" width="70%" mode="center" border-radius="14" :mask-close-able="false">
			<view class="entrust">
				<view class="entrust_text">交易品种：{{chedanmodul.instrumentID}}</view>
				<view class="entrust_text">操作：撤单/{{chedanmodul.limitPrice}}/{{chedanmodul.volumeTotalOriginal}}手</view>
				<view class="entrust_text">结果：<text class="success">撤单成功</text></view>
			</view>
			<view class="entrust_btn" @click="ischedan=false">确定</view>
		</u-popup>
		<u-popup v-model="isjiao" width="70%" mode="center" border-radius="14" :mask-close-able="false">
			<view class="make_cont">
				<view class="make_tit">交易成交通知</view>
				<view class="make_text">{{markemodul.instrumentID}}/
				<text v-if="markemodul.direction==0&&markemodul.combOffsetFlag==0">买涨</text>
				<text v-else-if="markemodul.direction==1&&markemodul.combOffsetFlag==0">买跌</text>
				<text v-else-if="markemodul.direction==1&&markemodul.combOffsetFlag==1">平涨</text>
				<text v-else>平跌</text>
				<!-- {{markemodul.direction==0?'买涨':'买跌'}} -->
				/{{markemodul.volumeTotalOriginal}}手</view>
				<view class="make_text">成交价：{{markemodul.limitPrice}}</view>
				<view class="make_btn">
					<view class="bottom bgr" @click="isjiaoFn">取消</view>
					<view class="bottom bgy" @click="isjiaoFn">查看</view>
				</view>
			</view>
		</u-popup>
	</view>
	<view v-else class="noLoginWrap">
		<view class="title-t">
			搜量量化
		</view>
		<u-grid :col="3" :border="false">
			<u-grid-item>
				<u-image width="80rpx" height="80rpx" src="../../../static/images/jisu.png"></u-image>
				<view class="grid-text">极速行情</view>
			</u-grid-item>
			<u-grid-item>
				<u-image width="80rpx" height="80rpx" src="../../../static/images/shandian.png"></u-image>
				<view class="grid-text">闪电下单</view>
			</u-grid-item>
			<u-grid-item>
				<u-image width="80rpx" height="80rpx" src="../../../static/images/caozuo.png"></u-image>
				<view class="grid-text">操作简单</view>
			</u-grid-item>
		</u-grid>
		<u-button type="primary" @click="ToLogin">立即开户</u-button>
		<u-button @click="deallogin">已有账号，马上添加</u-button>
		<view class="no-bottom" @click="affirm">开户由期货保证金监控中心提供</view>
	</view>
</template>

<script>
	// import Vue from 'vue'
	import BnnLoading from '@/components/bnn-ui/loading/index.vue'
	// import {affirmJieSuan} from '@/api/strategy.js'
	import {formatMoney} from '@/utils/index.js'
	const dcRichAlert = uni.requireNativePlugin('Trader')
	var globalEvent = uni.requireNativePlugin('globalEvent');
	var globalstr=''
	var globalData=[]
	var markeData=[]
	var Orderjiao=false
	var Orderweituo=false
	var global=''
	var marke=''
	var weitimer=null
	let num=1
	var cenum=-1
	// window.setInterval(function(){
	//     var refreshHours = new Date().getHours();
	//     var refreshMin = new Date().getMinutes();
	//     var refreshSec = new Date().getSeconds();
	//     if(refreshHours=='21' && refreshMin=='0' && refreshSec=='0'){
	//         // 指定做的事情
	//     }
	// }, 1000);
	// plus.nativeUI.alert('测试'+this)
	globalEvent.addEventListener('onRtnOrder', function(e) {
		// plus.nativeUI.alert('报单监听'+JSON.stringify(e))
		// if(globalData==''){
			if(e.orderStatus==3){//
				// uni.showToast({title:e.statusMsg,icon:'none'})
				globalstr=e
				Orderweituo=true
				global=e
				try{
					const gAccount=uni.getStorageSync('globalAccount')
					if(gAccount){
						const newArr=gAccount
						// let num=newArr.length
						// let newArr1 = newArr.map(function(item, key, ary) {
						// 	if (e.instrumentID === item.instrumentID) {
						// 		item = e
						// 	}else{
						// 		// globalData.push(e)
						// 	}
						// 	return item 
						// });	
						// newArr=newArr1
						// for(let i=0;i<num;i++){
						// 	if(newArr[i].instrumentID==e.instrumentID){
						// 		newArr[i]=e
						// 	}else{
						// 	}
						// }
						newArr.unshift(e)
						uni.setStorageSync('globalAccount',newArr);
					}else{
						globalData.unshift(e)
						uni.setStorageSync('globalAccount',globalData);
					}
					let date=new Date()
					let year = date.getFullYear()
					let month = date.getMonth()+1
					let day = date.getDate()
					let getDate=year.toString()+month.toString()+day.toString()
					uni.setStorageSync('globalTime',getDate);
				}catch(e){
					plus.nativeUI.alert('委托cuowu'+e)
				}
			}
			if(e.orderStatus==5){
				uni.showToast({title:e.statusMsg,icon:'none'})
			}
			if(e.orderStatus=='a'){
				uni.showToast({title:e.statusMsg,icon:'none'})
			}
			if(e.orderStatus==0){
				markeData.unshift(e)
				Orderjiao=true
				marke=e
				// uni.setStorageSync('markeAccount', e);
				try{
					const mAccount=uni.getStorageSync('markeAccount')
					if(mAccount){
						mAccount.unshift(e)
						uni.setStorageSync('markeAccount',mAccount);
					}else{
						uni.setStorageSync('markeAccount',markeData);
					}
				}catch(e){
					plus.nativeUI.alert('成交s'+e)
				}
			}
		// plus.nativeUI.alert('data'+JSON.stringify(globalData))
	});
	export default {
		components: {BnnLoading},
		data() {
			return {
				condistate:0,
				Accountprice:'',
				statebtn:-1,
				isweituo:false,
				isjiao:false,
				ischedan:false,
				searchText:'螺纹钢2105 rb2105',
				chText:'',
				screenHeight:450,
				show:false,
				isLogin: false,
				isLoading:true,
				value: 0,
				options: [{
						label: '螺纹钢2105 rb2105',
						value: 1,
					},
					{
						label: '螺纹钢2106 tv2106',
						value: 2,
					},
					{
						label: '螺纹钢2205 bu2205',
						value: 3,
					}
				],
				list: [{
					name: '持仓',
					value: 0
					}, {
					name: '委托',
					value: 1
					}, {
					name: '条件单',
					value: 2
					}, {
					name: '成交',
					value: 3
				}],
				current: 0,
				swiperCurrent: 0,
				dataList: [{
					name: '沥青2020',
					acount: '1/1',
					price: '2848',
					money: '4920.00',
					isZhang: false
						}, {
						name: '沥青2021',
						acount: '1/1',
						price: '2848',
						money: '4920.00',
						isZhang: true
						}, {
						name: '沥青2022',
						acount: '1/1',
						price: '2848',
						money: '4920.00',
						isZhang: false
						}, {
						name: '沥青2023',
						acount: '1/1',
						price: '2848',
						money: '4920.00',
						isZhang: true
						}, {
						name: '沥青2024',
						acount: '1/1',
						price: '2848',
						money: '4920.00',
						isZhang: false
						}, {
						name: '沥青2025',
						acount: '1/1',
						price: '2848',
						money: '4920.00',
						isZhang: true
				}, ],
				contentData:[],
				myFuturesData:[],
				dealData:[],
				dealTime:null,
				tradingAccount:null,
				storPosition:null,
				isShow:false,
				PositionData:[
					// {instrumentID:'J1212',closeProfit:1,position:1,openCost:1212,positionCost:56565,posiDirection:2,settlementPrice:12232},
					// {instrumentID:'YU1212',closeProfit:1,position:1,openCost:1212,positionCost:56565,posiDirection:2,settlementPrice:12232},
					// {instrumentID:'YU1212',closeProfit:1,position:1,openCost:1212,positionCost:56565,posiDirection:2,settlementPrice:12232},
					// {instrumentID:'YU1212',closeProfit:1,position:1,openCost:1212,positionCost:56565,posiDirection:2,settlementPrice:12232},
					// {instrumentID:'YU1212',closeProfit:1,position:1,openCost:1212,positionCost:56565,posiDirection:2,settlementPrice:12232},
					// {instrumentID:'YU1212',closeProfit:1,position:1,openCost:1212,positionCost:56565,posiDirection:2,settlementPrice:12232},
					// {instrumentID:'YU1212',closeProfit:1,position:1,openCost:1212,positionCost:56565,posiDirection:2,settlementPrice:12232},
					// {instrumentID:'YU1212',closeProfit:1,position:1,openCost:1212,positionCost:56565,posiDirection:2,settlementPrice:12232},
				],//持仓
				DeclarationData:[
					// {instrumentID:'J1212',direction:1,combOffsetFlag:1,stag:1,gnum:1,volumeTotalOriginal:5,limitPrice:22132,insertTime:12232},
					// {instrumentID:'YU1212',direction:1,combOffsetFlag:0,stag:1,gnum:1,volumeTotalOriginal:1,limitPrice:2457,insertTime:12232},
					// {instrumentID:'YU1212',direction:1,combOffsetFlag:1,stag:1,gnum:1,volumeTotalOriginal:2,limitPrice:2757,insertTime:12232},
					// {instrumentID:'YU1212',direction:1,combOffsetFlag:1,stag:1,gnum:1,volumeTotalOriginal:2,limitPrice:27,insertTime:12232},
					// {instrumentID:'YU1212',direction:1,combOffsetFlag:1,stag:1,gnum:1,volumeTotalOriginal:3,limitPrice:772,insertTime:12232},
					// {instrumentID:'YU1212',direction:0,combOffsetFlag:0,stag:1,gnum:1,volumeTotalOriginal:4,limitPrice:275,insertTime:12232},
					// {instrumentID:'YU1212',direction:1,combOffsetFlag:1,stag:0,gnum:1,volumeTotalOriginal:2,limitPrice:275,insertTime:12232},
					// {instrumentID:'YU1212',direction:0,combOffsetFlag:1,stag:0,gnum:1,volumeTotalOriginal:1,limitPrice:892,insertTime:12232},
				],//委托
				marketionData:[],//成交
				conditionData:[
					// {instrumentID:'YU1212',direction:1,combOffsetFlag:1,stag:0,gnum:1,volumeTotalOriginal:2,limitPrice:275,insertTime:12232},
					// {instrumentID:'YU1212',direction:0,combOffsetFlag:1,stag:0,gnum:1,volumeTotalOriginal:1,limitPrice:892,insertTime:12232},
				],//条件单
				globalmodul:'',
				markemodul:'',
				chedanmodul:'',
			}
		},
		onNavigationBarButtonTap:function(e){
			 // getApp().globalData.isAccount=false
			 if(this.isLogin)this.isShow=true;else uni.showToast({title:'请先登录账户',icon:'none'});
			 // uni.navigateTo({
			 // 	url:'./ranksearch/ranksearch'
			 // })
		},
		onLoad() {
			// globalEvent.addEventListener('onRtnOrder', function(e) {
			// 	plus.nativeUI.alert('报单监听'+JSON.stringify(e))
			// 		if(e.orderStatus==3){//
			// 			// uni.showToast({title:e.statusMsg,icon:'none'})
			// 			globalstr=e
			// 			Orderweituo=true
			// 			global=e
			// 			this.isweituo=true
			// 			this.globalmodul=e
			// 			try{
			// 				const gAccount=uni.getStorageSync('globalAccount')
			// 				if(gAccount){
			// 					const newArr=gAccount
			// 					newArr.unshift(e)
			// 					uni.setStorageSync('globalAccount',newArr);
			// 				}else{
			// 					globalData.unshift(e)
			// 					uni.setStorageSync('globalAccount',globalData);
			// 				}
			// 				let date=new Date()
			// 				let year = date.getFullYear()
			// 				let month = date.getMonth()+1
			// 				let day = date.getDate()
			// 				let getDate=year.toString()+month.toString()+day.toString()
			// 				uni.setStorageSync('globalTime',getDate);
			// 			}catch(e){
			// 				plus.nativeUI.alert('委托cuowu'+e)
			// 			}
			// 		}
			// 		if(e.orderStatus==5){
			// 			uni.showToast({title:e.statusMsg,icon:'none'})
			// 		}
			// 		if(e.orderStatus=='a'){
			// 			uni.showToast({title:e.statusMsg,icon:'none'})
			// 		}
			// 		if(e.orderStatus==0){
			// 			markeData.unshift(e)
			// 			Orderjiao=true
			// 			marke=e
			// 			this.isjiao=true
			// 			this.markemodul=e
			// 			try{
			// 				const mAccount=uni.getStorageSync('markeAccount')
			// 				if(mAccount){
			// 					mAccount.unshift(e)
			// 					uni.setStorageSync('markeAccount',mAccount);
			// 				}else{
			// 					uni.setStorageSync('markeAccount',markeData);
			// 				}
			// 			}catch(e){
			// 				plus.nativeUI.alert('成交s'+e)
			// 			}
			// 		}
			// });		
		},
		mounted(){
			// let query = uni.createSelectorQuery().in(this);
			// query.selectAll(".u-table").boundingClientRect();
			// query.exec((res) => {
			// 	// this.screenHeight = res[0][this.current].height
			// })
		},
		onShow() {
				// this.isLoading=true
				let webView = this.$mp.page.$getAppWebview();
				if(getApp().globalData.isAccount){
					if(this.contentData==''){
						this.isLoading=true
					}
				// if(true){
					// this.PositionData=Investvalue
					this.isLogin=true
					let that=this
					webView.setTitleNViewButtonStyle(0, {
						width: '30',
					});
					this.reqTradingAccount()
					// this.reqInvestorPosition()
					// if(globalstr.orderStatus==3){
					// 	this.DeclarationData.push(globalstr)
					// }
					// if(markeData){
					// 	this.marketionData=markeData
					// }
					this.isjiao=Orderjiao
					this.isweituo=Orderweituo
					
					this.globalmodul=global
					this.markemodul=marke
					this.myFutures()
					setTimeout(()=>{
						this.isLoading=false
						// this.affirm()
					},2000)
					try {//获取委托信息
						const value = uni.getStorageSync('globalAccount');
						const mvalue = uni.getStorageSync('markeAccount');
						plus.nativeUI.alert('获取存储'+JSON.stringify(value))
						if(mvalue){
							this.marketionData=mvalue
							// plus.nativeUI.alert('存储2'+JSON.stringify(this.marketionData))
						}
						if(value){
							let arrValue=value
							let arrmark=mvalue
							// let arr=[]
								for(let i=0; i<arrValue.length; i++){
									try{
										if(arrValue[i].stag==2){
											arrValue[i].stag=2
										}else{
											arrValue[i].stag=0
										}
									}catch(e){
										arrValue[i].stag=0
									}
									arrValue[i].gnum=0
									for(let j=i+1; j<arrValue.length; j++){
										if(arrValue[i].orderLocalID==arrValue[j].orderLocalID){         //第一个等同于第二个，splice方法删除第二个
											arrValue.splice(j,1);
											j--;
										}
									}
								}
							if(mvalue){	
								for(let j=0;j<arrmark.length;j++){
									for(let y=0;y<arrValue.length;y++){
										if(arrmark[j].instrumentID==arrValue[y].instrumentID&&arrmark[j].direction==arrValue[y].direction&&arrmark[j].combOffsetFlag==arrValue[y].combOffsetFlag){
										// if(arrmark[j].orderLocalID==arr[y].orderLocalID){
											arrValue[y].stag=1
											arrValue[y].gnum=arrmark[j].volumeTotalOriginal
										}else{
											if(arrValue[y].stag==2){
												arrValue[y].gnum==1
											}else{
												arrValue[y].stag=0
												arrValue[y].gnum=0
											}
										}
									}
								}
								// this.DeclarationData=arr
							}
							// if(cenum>=0){
							// 	arrValue[cenum].stag=2
							// }
							this.DeclarationData=arrValue
							// plus.nativeUI.alert('筛选后得存储'+JSON.stringify(arrValue))
						}
					} catch (e) {
						plus.nativeUI.alert('获取'+JSON.stringify(e))
					}
					try{
						const mvalue = uni.getStorageSync('markeAccount');
						if(mvalue){
							this.marketionData=mvalue
							// plus.nativeUI.alert('存储2'+JSON.stringify(this.marketionData))
						}
					}catch(e){
						plus.nativeUI.alert('获取2'+JSON.stringify(e))
					}
					// // 持仓详情
					// setTimeout(()=>{
					// 	try{
					// 		let data={
					// 			BrokerID:this.contentData.brokerID,
					// 			InvestorID:this.contentData.investorID
					// 		}
					// 	dcRichAlert.reqQryInvestorPositionDetail({data},function(ret){
					// 		plus.nativeUI.alert('持仓详情'+JSON.stringify(ret))
					// 		// uni.setStorageSync('InvestorPosition', res.data);
					// 	})
					// 	}catch(e){
					// 		plus.nativeUI.alert(e)
					// 	}
					// },2000)
					// uni.hideHomeButton()
				}else{
					this.isLoading=false
					this.isLogin=false
					webView.setTitleNViewButtonStyle(0, {
						width: '0',
					});
					// this.myFutures()
				}			 
			// plus.nativeUI.alert(JSON.stringify(dcRichAlert));
		},
		onHide(){
			if(this.dealTime){
				clearInterval(this.dealTime)
				this.dealTime = null
			}
			if(this.tradingAccount){
				clearInterval(this.tradingAccount)
				this.tradingAccount=null
			}
			if(this.storPosition){
				clearInterval(this.storPosition)
				this.storPosition=null
			}
		},	
		methods: {
			condistateFn(index){
				this.condistate=index
			},
			setSwiperHeight(){
				// this.$nextTick(()=>{
					let query = uni.createSelectorQuery().in(this);
					query.selectAll(".u-table").boundingClientRect();
					query.exec((res) => {
						this.screenHeight = res[0][this.current].height;
					})
				// }
			},
			isweituoFn(){
				this.isweituo=false
				Orderweituo=false
				// Vue.prototype.$isweituo = false
			},
			isjiaoFn(){
				this.isjiao=false
				Orderjiao=false
				// Vue.prototype.$isjiao = false
			},
			checkedFn(i){
				if(this.statebtn==i){
					this.statebtn=-1
				}else{
					this.statebtn=i
				}
			},
			flatFn(){},
			affirmtime(){//是否确认结算单
				this.isShow=false
				uni.navigateTo({
					url:'/pages/tabBar/transaction/stetementime/index'
				})
			},
			affirm(){
					this.isShow=false
					uni.navigateTo({
						url:'./statement/index'
					})
			},
			reqTradingAccount(){//获取账户信息
				let that=this
				// try {
					this.tradingAccount=setInterval(()=>{
						dcRichAlert.reqQrySecAgentTradingAccount({}, function(res) {
							if(that.contentData==''){
								// plus.nativeUI.alert('账户'+JSON.stringify(res))
							}
							if(res.code==200){
								// plus.nativeUI.alert(JSON.stringify(res))
								// if(that.contentData==''){
								// }
									if(res.data instanceof Object  ){
										getApp().globalData.available=res.data.available
										that.Accountprice=res.data.balance
										res.data.balance=formatMoney(res.data.balance)
										res.data.available=formatMoney(res.data.available)
										that.contentData=res.data
										that.reqInvestorPosition(res.data)
										// let {preBalance,available,positionProfit,currMargin}=res.data
										// let Accountprice=formatMoney(preBalance)
										// let Aavailable=formatMoney(available)
										// that.contentData={
										// 	Accountprice:Accountprice,
										// 	preBalance:preBalance,
										// 	currMargin:currMargin,
										// 	positionProfit:positionProfit,
										// 	available:Aavailable
										// }
									}
								// uni.setStorageSync('TradingAccount', res.data);
							}
						})
					},1800)
					
				// } catch (e) {
				// 	plus.nativeUI.alert(JSON.stringify(e))
				// }
			},
			reqInvestorPosition(item){//持仓查询
				let thet=this
				// this.storPosition=setInterval(()=>{
					dcRichAlert.reqQryInvestorPosition({},function(res){
						// try{
							if(thet.PositionData==''){
								// plus.nativeUI.alert('持仓'+JSON.stringify(res))
								// thet.PositionData.push(res.data)
							}
							if(Array.isArray(res.data)){
								// thet.PositionData=res.data.filter(function(item){
								// 	return item.position!=0
								// )}
								// uni.setStorageSync('reqQryposition',res.data);
								let pdata=res.data.filter(function(item){
									return item.position!=0
								})
								try{
									let data={
										BrokerID:item.brokerID,
										InvestorID:item.investorID,
										ExchangeID:item.exchangeID,
										InvestUnitID:item.investUnitID,
										// InstrumentID:'j2105'
									}
									dcRichAlert.reqQryInvestorPositionDetail(data,function(ret){
										// if(){
											// plus.nativeUI.alert('持仓详情'+JSON.stringify(ret))
										// }
											// pdata[i]['ByTrade']="0"
										if(Array.isArray(ret.data)){
										let Ddata=ret.data
										let pnum=pdata.length
										let dnum=Ddata.length
										try{
											let prisenum=0
											let fitnum=0
										for(let i=0;i<pnum;i++){
											pdata[i]['ageprice']=0
											pdata[i]['agenum']=0
											for(let j=0;j<dnum;j++){
													if(Ddata[j].hasOwnProperty('direction')&&Ddata[j].hasOwnProperty('openPrice')&&Ddata[j].hasOwnProperty('positionProfitByTrade')){
														if(pdata[i].posiDirection==3&&pdata[i].instrumentID==Ddata[j].instrumentID&&Ddata[j].direction==Ddata[j].hedgeFlag){
															pdata[i].ageprice+=Ddata[j].openPrice
															pdata[i].agenum+=1
															pdata[i].positionProfit+=Ddata[j].positionProfitByTrade
														}
														if(pdata[i].posiDirection==2&&pdata[i].instrumentID==Ddata[j].instrumentID&&Ddata[j].direction!=Ddata[j].hedgeFlag){
															pdata[i].ageprice+=Ddata[j].openPrice
															pdata[i].agenum+=1
															pdata[i].positionProfit+=Ddata[j].positionProfitByTrade
														}
													}
											}
										}
										}catch(e){
											plus.nativeUI.alert('持仓循环报错'+JSON.stringify(e))
										}
										thet.PositionData=pdata
										uni.setStorageSync('reqQryposition',pdata);
										// plus.nativeUI.alert('持仓合并'+JSON.stringify(pdata))
									//持仓多空方向 PosiDirection 2涨  3跌
									//投机套保标志 hedgeFlag
									//买卖 direction 
									// 	// uni.setStorageSync('InvestorPosition', res.data);
									}
									})
								}catch(e){
									plus.nativeUI.alert(e)
								}
							}
							// if(res.data.prototype.toString.call(obj) === '[Object Object]'){
							// 	thet.PositionData
							// }
						// plus.nativeUI.alert(JSON.stringify(thet.PositionData))
					})
				// },2500)
			},
			repealFn(item,index){//撤单
				let thst=this
				let data={
					ActionFlag:'0',//操作标志
					BrokerID:item.brokerID,//经纪公司代码
					InvestorID:item.investorID,//
					ExchangeID:item.exchangeID, ///交易所代码
					InstrumentID:item.instrumentID,///合约代码
					UserID:item.userID,///用户代码
					OrderSysID:item.orderSysID,///报单编号
					SessionID:item.sessionID,///会话编号
					OrderRef:item.orderRef,///报单引用
					FrontID:item.frontID,///前置编号
					// LimitPrice:item.limitPrice,//
					// VolumeChange:item.volumeTotalOriginal,
					// nRequestID:'1'
				}
				// globalEvent.removeEventListener('onRtnOrder', function(e) {})
				 
				// plus.nativeUI.alert('撤单提交数据'+JSON.stringify(data))
				try{
					let action=0
					dcRichAlert.reqOrderAction(data,function(res){
						// plus.nativeUI.alert('撤单回调'+JSON.stringify(res))
						action=1
						// if(res.data==200){
						// 	thst.DeclarationData[index].stag=2
						// 	thst.chedanmodul=res.data
						// 	thst.ischedan=true
						// 	try{
						// 		const value = uni.getStorageSync('globalAccount');
						// 		if(value){
						// 			let chedata=value
						// 			chedata[index].stag=2
						// 			uni.setStorageSync('globalAccount',chedata);
						// 		}
						// 	}catch(e){
								
						// 	}
						// }else{
						// 	uni.showToast({title:res.message,icon:'none'})
						// }
						uni.showToast({title:res.message,icon:'none'})
						if(res.code==26){
							item.stag=2
							// thst.DeclarationData.push(item)
							thst.DeclarationData[index]=item
							// cenum=index
							// thst.chedanmodul=res.data
							// thst.ischedan=true
							let tdata=thst.DeclarationData
							// plus.nativeUI.alert('撤单存数据'+JSON.stringify(tdata))
							try{
								uni.setStorageSync('globalAccount',tdata);
							}catch(e){
								plus.nativeUI.alert('撤单存'+JSON.stringify(e))
							}
						}
					})
						setTimeout(()=>{
							if(action==0){
									item.stag=2
									// thst.DeclarationData.push(item)
									thst.DeclarationData[index]=item
									let rdata=thst.DeclarationData
									// cenum=index
									// plus.nativeUI.alert('撤单存数据2'+JSON.stringify(rdata))
									try{
										uni.setStorageSync('globalAccount',rdata);
									}catch(e){
										plus.nativeUI.alert('撤单cun'+JSON.stringify(e))
									}
							}
						},1000)
				}catch(e){
					plus.nativeUI.alert('撤单报错'+JSON.stringify(e))
				}
			},
			quitClick(){
				try {
				    // uni.removeStorageSync('TradingAccount');
					this.isLogin=false
					getApp().globalData.isAccount=false
					this.isShow=false
					this.PositionData=[]
					this.contentData=[]
					this.DeclarationData=[]
					let webView = this.$mp.page.$getAppWebview();
					webView.setTitleNViewButtonStyle(0, {
						width: '0',
					});
					if(this.dealTime){
						clearInterval(this.dealTime)
						this.dealTime = null
					}
					if(this.tradingAccount){
						clearInterval(this.tradingAccount)
						this.tradingAccount=null
					}
					if(this.storPosition){
						clearInterval(this.storPosition)
						this.storPosition=null
					}
					dcRichAlert.reqUserLogout({},function(res){
						// if(){
					uni.showToast({title:'账户退出成功',icon:'none'})
						// }
						// plus.nativeUI.alert('账户退出'+JSON.stringify(res))
						
					})
					uni.removeStorageSync('globalAccount')
					uni.removeStorageSync('markeAccount')
				} catch (e) {
				    // error
				}
			},
			searchFn(){
				uni.navigateTo({
					url:'../rank/ranksearch/ranksearch?index=1'
				})
			},
			clickFutures(i,name){ //点击改变自选
				this.searchText=name
				this.value=i
				let {instrument_id}=this.myFuturesData[i]
				let text=instrument_id.split('.')
				this.chText=text[1]			
				clearInterval(this.dealTime)
				this.dealTime = null
				this.dealdata(instrument_id)
				this.show=false
			},
			myFutures(){ //获取自选
				let {id} = uni.getStorageSync('MEMBER_INFO')
				uni.request({
					url:'http://47.102.157.67:9500/api/myFutures',
					data: {id:id},
					success: (res) => {
						this.myFuturesData=res.data
						this.searchText=res.data[0].name
						let {instrument_id}=res.data[0]
						let text=res.data[0].instrument_id.split('.')
						this.chText=text[1]
						// this.options
						this.dealdata(instrument_id)
					}
				})
			},
			dealdata(n){//获取行情
				this.dealTime=setInterval(()=>{
					uni.request({
						url:'http://47.102.157.67:9500/newData',
						data:{name:n},
						success:(res)=>{
							this.dealData=res.data
						}
					}) 
				},1000)				
			},
			searchTextFn(){
				this.show=true
			},
			closeDropdown() {
				this.$refs.uDropdown.close();
			},
			change(index) {
				this.current = index;
				this.swiperCurrent = index;
			},
			// tabsChange
			// tabs通知swiper切换
			tabsChange(index) {
				this.current = index;
				this.swiperCurrent = index;
				// if(index==1){
				// const Detion=uni.getStorageSync('Declaration_key')
				// for(let i=0;i<num;i++){
				// 	if(that.PositionData[i].instrumentID==Detion.instrumentID){
				// 		that.PositionData[i]=Detion
				// 	}else{
				// 		this.DeclarationData.push(Detion)
				// 	}
				// }
				// }
			},
			// swiper-item左右移动，通知tabs的滑块跟随移动
			transition(e) {
				// let dx = e.detail.dx;
				// this.$refs.uTabs.setDx(dx);
			},
			// 由于swiper的内部机制问题，快速切换swiper不会触发dx的连续变化，需要在结束时重置状态
			// swiper滑动结束，分别设置tabs和swiper的状态
			animationfinish(e) {
				let current = e.detail.current;
				// this.$refs.uTabs.setFinishCurrent(current);
				this.swiperCurrent = current;
				this.current = current;
			},
			// scroll-view到底部加载更多
			onreachBottom() {
				
			},
			ToTrading(index,id) {
				// let id=item.exchangeID+'.'+item.instrumentID
				// let type=0
				// if(item.posiDirection==2){
				// 	type=0 //涨
				// }else{
				// 	type=1 //跌
				// }
				uni.navigateTo({
					url: './trading/index?index='+index+'&id='+id
				})
			},
			ToTrading2(item) {//去平仓
				let id=item.exchangeID+'.'+item.instrumentID
				let type=0
				if(item.posiDirection==2){
					type=0 //涨
				}else{
					type=1 //跌
				}
				uni.navigateTo({
					url: './trading/index?index=3&id='+id+'&type='+type+'&prise='+item.positionProfit
				})
			},
			ToTrading3(item) {//止盈止损
				let id=item.exchangeID+'.'+item.instrumentID
				let type=0
				if(item.posiDirection==2){
					type=0 //涨
				}else{
					type=1 //跌
				}
				uni.navigateTo({
					url: './trading/index?index=3&loss=1&id='+id+'&type='+type+'&prise='+item.positionProfit
				})
			},
			ToLogin(){
				uni.navigateTo({url:'/pages/account/open/index'})
			},
			deallogin(){
				const user =uni.getStorageSync('MEMBER_INFO')
				if(user)uni.navigateTo({url:'/pages/user/dealLogin/dealLogin'});
				else uni.navigateTo({url:'/pages/user/login/index?user=1'});
				// alert(1234)
			}
		}
	}
	//经纪公司代码
	//     TThostFtdcBrokerIDType BrokerID;
	//     ///投资者帐号
	//     TThostFtdcAccountIDType AccountID;
	//     ///上次质押金额
	//     TThostFtdcMoneyType PreMortgage;
	//     ///上次信用额度
	//     TThostFtdcMoneyType PreCredit;
	//     ///上次存款额
	//     TThostFtdcMoneyType PreDeposit;
	//     ///上次结算准备金
	//     TThostFtdcMoneyType PreBalance;
	//     ///上次占用的保证金
	//     TThostFtdcMoneyType PreMargin;
	//     ///利息基数
	//     TThostFtdcMoneyType InterestBase;
	//     ///利息收入
	//     TThostFtdcMoneyType Interest;
	//     ///入金金额
	//     TThostFtdcMoneyType Deposit;
	//     ///出金金额
	//     TThostFtdcMoneyType Withdraw;
	//     ///冻结的保证金
	//     TThostFtdcMoneyType FrozenMargin;
	//     ///冻结的资金
	//     TThostFtdcMoneyType FrozenCash;
	//     ///冻结的手续费
	//     TThostFtdcMoneyType FrozenCommission;
	//     ///当前保证金总额
	//     TThostFtdcMoneyType CurrMargin;
	//     ///资金差额
	//     TThostFtdcMoneyType CashIn;
	//     ///手续费
	//     TThostFtdcMoneyType Commission;
	//     ///平仓盈亏
	//     TThostFtdcMoneyType CloseProfit;
	//     ///持仓盈亏
	//     TThostFtdcMoneyType PositionProfit;
	//     ///期货结算准备金
	//     TThostFtdcMoneyType Balance;
	//     ///可用资金
	//     TThostFtdcMoneyType Available;
	//     ///可取资金
	//     TThostFtdcMoneyType WithdrawQuota;
	//     ///基本准备金
	//     TThostFtdcMoneyType Reserve;
	//     ///交易日
	//     TThostFtdcDateType TradingDay;
	//     ///结算编号
	//     TThostFtdcSettlementIDType SettlementID;
	//     ///信用额度
	//     TThostFtdcMoneyType Credit;
	//     ///质押金额
	//     TThostFtdcMoneyType Mortgage;
	//     ///交易所保证金
	//     TThostFtdcMoneyType ExchangeMargin;
	//     ///投资者交割保证金
	//     TThostFtdcMoneyType DeliveryMargin;
	//     ///交易所交割保证金
	//     TThostFtdcMoneyType ExchangeDeliveryMargin;
	//     ///保底期货结算准备金
	//     TThostFtdcMoneyType ReserveBalance;
	//     ///币种代码
	//     TThostFtdcCurrencyIDType CurrencyID;
	//     ///上次货币质入金额
	//     TThostFtdcMoneyType PreFundMortgageIn;
	    ///上次货币质出金额
	    // TThostFtdcMoneyType PreFundMortgageOut;
	    ///货币质入金额
	    // TThostFtdcMoneyType FundMortgageIn;
	    ///货币质出金额
	    // TThostFtdcMoneyType FundMortgageOut;
	    ///货币质押余额
	    // TThostFtdcMoneyType FundMortgageAvailable;
	    ///可质押货币金额
	    // TThostFtdcMoneyType MortgageableFund;
	    ///特殊产品占用
</script>

<style lang="scss" scoped>
	.emp-hight{
		height: 100px;
	}
	.type_cont{
		padding: 10px 15px;
		display: flex;
		.condi_item{
			width: 80px;
			text-align: center;
		}
		.condi_item1{
			width: 60px;
			text-align: center;
		}
		.condi_item2{
			width: 80px;
			text-align: center;
		}
		.condi_item3{
			width: 120px;
			text-align: center;
		}
	}
	.condition_msg{
		padding: 15px 5px;
		.feng{
			color: #ff4d59;
			font-size: 13px;
		}
		.text{
			font-size: 12px;
			color: #928f8f;
		}
	}
	.condition_cont{
		width: 100%;
		display: flex;
		justify-content: space-around;
		align-items: center;
		padding: 5px;
		background-color: #fff;
		border-top: 1px solid #f9f9f9;
		.condition_item{
			width: 50px;
			// height: 45px;
			font-size: 13px;
			// line-height: 45px;
			text-align: center;
			padding: 2px;
		}
		.condistate{
			border: 1px solid #EFAB00;
			color: #EFAB00;
			border-radius: 5px;
			// background-color: ;
		}
	}
	.u-tr{
		border-bottom: 1px solid #f9f9f9;
	}
	.Position{
		border-bottom: 1px solid #f9f9f9;
		// padding: 5px;
		.tionitem{
			display: flex;
			align-items: center;
			text-align: center;
			padding: 10px 0;
			.item1{
				width: 30%;
				display: flex;
				flex-direction: column;
			}
			.item2{
				width: 30%;
			}
			.item3{
				width: 20%;
			}
			.item4{
				width: 20%;
			}
			.Decitem1{
				width: 25%;
				display: flex;
				flex-direction: column;
			}
			.Decitem2{width: 15%;}
			.stag{border: 1px solid #d3d6d6;border-radius: 5px;padding: 2px 0;}
			.Decitem3{width: 25%;}
			.Decitem4{width: 15%;}
			.Decitem5{width: 20%;}
		}
	}
	.Positionbtn{
		color:#EFAB00;
		display: flex;
		justify-content: center;
		margin-bottom:5px;
		padding: 0 0 5px;
	}
	.checked{
		background-color: #fdfcf7;
	}
	.btnStyle{
		color:#EFAB00;
		border-color: #c0c4cc;
	}
	.btnStyle1{
		color:#EFAB00;
		border-color: #c0c4cc;
		margin-left: 5px;
	}
	.make_cont{
		padding: 10px;
		.make_tit{
			font-size: 18px;
			font-weight: bold;
			text-align: center;
			margin:5px 0 10px;
		}
		.make_text{
			line-height: 30px;
		}
		.make_btn{
			display: flex;
			justify-content: space-between;
			text-align: center;
			margin-top: 10px;
			font-size: 16px;
			.bottom{
				width: 48%;
				height: 40px;
				line-height: 40px;
				color: #fff;
				text-align: center;
				border-radius:10px;
			}
			.bgr{
				background-color: #d3d6d6;
			}
			.bgy{
				background-color: #EFAB00;
			}
		}
	}
	.entrust{
		padding:10px 15px;
		font-size: 16px;
		.entrust_text{
			line-height: 25px;
			.success{
				color:#EFAB00 ;
			}
		}
	}
	.entrust_btn{
		width: 100%;
		height: 44px;
		line-height: 44px;
		text-align: center;
		color:#EFAB00;
		font-size: 16px;
		border-top: 1rpx solid #676666;
	}
	.popup_tit{
		width: 100%;
		text-align: center;
		font-size: 16px;
		padding: 10px 0;
	}
	.Positionnum{
		margin-top: 10px;
		font-size: 12px;
		text-align: center;
		color: #e9e9e9;
	}
	.content {
			padding: 24rpx;
			// text-align: center;
			// display: flex;
			// flex-wrap:wrap;
			// justify-content: space-around;
			// align-items:flex-start;
			// align-content: flex-start;
			.cont_item{
				// flex: 0.33;
				width: 30%;
				height: 60rpx;
				display: inline-block;
				line-height: 60rpx;
				text-align: center;
				margin-left: 2%;
				margin-top: 5px;
				border: 1px solid #E8E8E8;
				border-radius: 20rpx;
			}
			.sta{
				border: 1px solid #FDA600;
				color: #FDA600;
			}
	}
	.jy-wrap {
		width: 100%;
		// height: 100vh;
		min-height: 100%;
		background-color: $uni-bg-color-grey;

		.jy-topWrap {
			width: 90%;
			margin-left: 5%;
			background-color: $uni-bg-color;
			height: 230rpx;
			border-radius: 10rpx;
			box-shadow: 0 0 9px 3px #F2F2F2;
			margin-top: 10rpx;

			.jy-content-t {
				width: 90%;
				margin-left: 5%;
				height: 150rpx;
				border-bottom: 1px solid $uni-border-color;
				display: flex;
				padding-top: 20rpx;

				.content-text {
					flex: 1;

					.title-gray {
						color: $uni-text-color-grey;
						font-size: $uni-font-size-lg;
					}

					.text-number {
						color: $uni-text-color;
						font-size: $uni-font-size-lg;
						margin-top: 20rpx;
						font-weight: 600;
					}
				}

				.content-text-r {
					flex: 1;
					text-align: right;

					.paogress_class {
						.progress {
							width: 200rpx;
						}
					}
				}
			}

			.jy-content-b {
				width: 90%;
				margin-left: 5%;
				height: 80rpx;
				display: flex;
				justify-content: flex-start;
				align-items: center;
				font-size: $uni-font-size-base;

				.content-l {
					flex: 1;

					.title-class {
						color: $uni-text-color-grey;
					}
				}

				.content-r {
					flex: 1;
					text-align: right;

					.title-class {
						color: $uni-text-color-grey;
					}
				}
			}
		}
	}

	.jy-dataWrap {
		width: 100%;
		height: 380rpx;
		background-color: $uni-bg-color;
		margin-top: 20rpx;

		.search-wrap {
			width: 100%;
			height: 100rpx;
			padding: 0 10px;
			display: flex;
			justify-content: center;
			align-items: center;
			padding-top: 40rpx;

			.dropdown-wrap {
				width: 90%;
				flex: 5;
				// height: 80rpx;
				// border: 1px solid $uni-border-color;
				// border-radius: 10rpx;
				// margin-left: 5%;
				// text-align: left;
				// line-height: 80rpx;
				// box-shadow: 0 0 9px 3px #F2F2F2;
			}
			.search_cont{
				width: 90%;
				height: 80rpx;
				padding: 0 20rpx;
				flex: 5;
				display: flex;
				justify-content: space-between;
				align-items: center;
				border: 1px solid $uni-border-color;
				border-radius: 10rpx;
				
			}
			.search {
				flex: 1;

				image {
					width: 50rpx;
					height: 50rpx;
					margin-left: 40rpx;
				}
			}
		}

		.dataView {
			width: 100%;
			height: 100rpx;
			padding-left: 5%;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			margin-top: 20rpx;

			.data-l {
				flex: 1;
				color: red;

				.data-l-wrap {
					margin-top: 20rpx;
					display: flex;
					height: 100rpx;
					align-items: center;

					.number-l {
						// font-size: $uni-font-size-lg;
						font-size: 44rpx;
						font-weight: 600;
					}

					.number-r {
						font-size: $uni-font-size-sm;
						margin-left: 20rpx;
					}
				}

			}

			.data-r {
				flex: 1;

				.right-wrap {
					margin-top: 20rpx;
					display: flex;
					height: 100rpx;
					align-items: center;

					.right-number {
						flex: 1;
						color: $uni-text-color-grey;
						margin-left: 10rpx;
					}
				}
			}
		}

		.acount-wrap {
			width: 90%;
			height: 100rpx;
			margin-left: 5%;
			display: flex;
			justify-content: center;
			align-items: center;
			margin-top: 20rpx;
			color: #FFFFFF;

			.zhangWrap {
				flex: 1;
				height: 100%;
				background-color: #ff4d59;
				text-align: center;
				border-radius: 10rpx;
			}

			.dieWrap {
				flex: 1;
				height: 100%;
				background-color: #3dbf61;
				text-align: center;
				margin-left: 20rpx;
				border-radius: 10rpx;
			}

			.pingWrap {
				flex: 1;
				height: 100%;
				background-color: #fda600;
				text-align: center;
				margin-left: 20rpx;
				border-radius: 10rpx;
			}

			.zhang-t {
				width: 100%;
				display: flex;
				justify-content: center;
				align-items: center;
				margin-top: 10rpx;

				image {
					width: 40rpx;
					height: 40rpx;
				}

				font-size: $uni-font-size-lg;

				span {
					margin-left: 10rpx;
				}
			}

			.zhang-b {
				margin-top: 10rpx;
				font-size: $uni-font-size-sm;
			}
		}
	}

	.table-wrap {
		width: 100%;
		margin-top: 20rpx;
	}

	.noLoginWrap {
		width: 100%;
		height: 100vh;
		background-color: $uni-bg-color;
		
		.title-t {
			width: 100%;
			text-align: center;
			padding-top: 80rpx;
			// font-family:Georgia;
			// font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
			font-family: Georgia, 'Times New Roman', Times, serif;
			font-weight: 800;
			font-size: 106rpx;
		}

		.u-grid {
			margin-top: 200rpx;
			margin-bottom: 100rpx;
		}

		.grid-text {
			font-size: 28rpx;
			margin-top: 16rpx;
			color: $u-type-info;
		}

		.u-button {
			margin-top: 50rpx;
		}

		uni-button {
			margin: 40rpx;
		}

		.no-bottom {
			width: 100%;
			height: 50rpx;
			line-height: 50rpx;
			text-align: center;
			position: absolute;
			bottom: 30rpx;
			color: $uni-text-color-grey;
			font-size: $uni-font-size-sm;
		}
	}
</style>
